package com.hclc.yxb.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hclc.entity.dto.SelectUserCustomersDto;
import com.hclc.entity.model.page.PageUtil;
import com.hclc.entity.model.result.ResultEntity;
import com.hclc.yxb.ao.SelectUserCustomersAo;
import com.hclc.yxb.service.UserConsoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/** ('-')
 * 后台用户信息
 * @author ljj
 * @version 1.0
 * @date 2020/10/19 15:51
 */
@Api(tags = "WEB 1.0-userCustomer", description = "用户信息")
@RestController
@RequestMapping("console/userCustomer")
@Validated
public class UserServiceController {

    @Autowired
    private UserConsoleService userConsoleService;

    /**
     * 获取用户信息列表
     * @param util
     * @return com.hclc.hxwy.model.result.ResultEntity<com.baomidou.mybatisplus.core.metadata.IPage<com.hclc.hxwy.dvo.SelectUserCustomersDvo>>
     * @author ljj
     * @version 1.0
     * @date 2020/10/19 15:53
     */
    @ApiOperation("获取用户信息列表")
    @PostMapping(value = "/getUserCustomers", produces = {MediaType.APPLICATION_JSON_VALUE})
    public ResultEntity<IPage<SelectUserCustomersDto>> getUserCustomers(@ApiParam(value = "分页信息")  @RequestBody PageUtil<SelectUserCustomersAo> util) {
        return ResultEntity.ResultSuccess(userConsoleService.selectUserCustomers(util));
    }
}
